// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   ControlFunc.java

package com.hfstu.ifs.model;

import com.hfstu.framework.model.PersistentNode;
import org.apache.commons.lang3.builder.ToStringBuilder;

// Referenced classes of package com.hfstu.ifs.model:
//			Action, ControlRegister

public class ControlFunc extends PersistentNode
{

	private Action action;
	private String bgUrl;
	private String bgClassName;
	private String bgMethodName;
	private String actionParameter;
	private ControlRegister controlRegister;

	public ControlFunc()
	{
	}

	public Action getAction()
	{
		return action;
	}

	public void setAction(Action action)
	{
		this.action = action;
	}

	public String getBgUrl()
	{
		return bgUrl;
	}

	public void setBgUrl(String bgUrl)
	{
		this.bgUrl = bgUrl;
	}

	public String getBgClassName()
	{
		return bgClassName;
	}

	public void setBgClassName(String bgClassName)
	{
		this.bgClassName = bgClassName;
	}

	public String getBgMethodName()
	{
		return bgMethodName;
	}

	public void setBgMethodName(String bgMethodName)
	{
		this.bgMethodName = bgMethodName;
	}

	public String getActionParameter()
	{
		return actionParameter;
	}

	public void setActionParameter(String actionParameter)
	{
		this.actionParameter = actionParameter;
	}

	public ControlRegister getControlRegister()
	{
		return controlRegister;
	}

	public void setControlRegister(ControlRegister controlRegister)
	{
		this.controlRegister = controlRegister;
	}

	public String toString()
	{
		return ToStringBuilder.reflectionToString(this);
	}

	public String toJson()
	{
		StringBuilder json = new StringBuilder();
		json.append("{");
		json.append("'id':").append("'").append(super.getId()).append("',");
		json.append("'code':").append("'").append(super.getCode()).append("',");
		json.append("'name':").append("'").append(super.getName()).append("',");
		json.append("'actionId':").append("'").append(action != null ? action.getId() : "").append("',");
		json.append("'actionName':").append("'").append(action != null ? action.getName() : "").append("',");
		json.append("'controlRegisterId':").append("'").append(controlRegister != null ? controlRegister.getId() : "").append("',");
		json.append("'bgUrl':").append("'").append(getBgUrl()).append("',");
		json.append("'bgClassName':").append("'").append(getBgClassName()).append("',");
		json.append("'bgMethodName':").append("'").append(getBgMethodName()).append("',");
		json.append("'actionParameter':").append("'").append(getActionParameter()).append("',");
		json.append("}");
		return json.toString();
	}
}
